import random
import string


class RandomCollection():
    # 获取26个大小写字母
    letters = string.ascii_letters
    # 获取26个小写字母
    Lowercase_letters = string.ascii_lowercase
    # 获取26个大写字母
    Capital = string.ascii_uppercase
    # 获取阿拉伯数字
    digits = string.digits


def random_str(length: int):
    # s是小写字母和数字的集合
    s = RandomCollection.Lowercase_letters + RandomCollection.digits
    # 生成28位小写和数字的集合，并将列表转字符串
    return ''.join(random.sample(s, length))


if __name__ == "__main__":
    random_str(2)
